import asyncio

async def tcp_echo_client(message):
    """请求codemao 时间接口"""
    reader, writer = await asyncio.open_connection("creation-hardware.codemao.cn", 3000)

    print(f"Send: {message!r}")
    writer.write(message.encode())
    await writer.drain()

    data = await reader.read(100)
    print(f"Received: {data.decode()!r}")

    print("Close the connection")
    writer.close()
    await writer.wait_closed()


asyncio.run(tcp_echo_client('{"op": "query", "name": "time"}'))